package com.wys.ws_im.controller;

import com.wys.ws_im.entity.Service;
import com.wys.ws_im.service.CustomerService;
import com.wys.ws_im.utils.ResultUtil;
import com.wys.ws_im.vo.ResultVO;
import com.wys.ws_im.vo.ServiceListVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.util.List;

/**
 * 客服
 *
 * @author wys
 * created in 0:59 2019/4/23
 */
@Slf4j
@CrossOrigin
@RestController
@RequestMapping("/service")
public class CustomerServiceController {

    @Autowired
    private CustomerService customerService;
    @Autowired
    private LoginState loginState;

    /**
     * 获取客服的用户聊天列表
     * @param account
     * @return
     */
    @GetMapping("/list")
    public ResultVO getList(String account) {

        List<ServiceListVO> list = customerService.getServiceList();
        return ResultUtil.success(0, "获取成功", list);
    }

    /**
     * 店主获取客服列表
     * @param aid
     * @return
     */
    @GetMapping("/serviceNames")
    public ResultVO getServiceNames(Integer aid) {

        List<String> list = customerService.getServiceNames(aid);
        return ResultUtil.success(0, "获取成功", list);
    }

}
